﻿@using Lavka.Models
@model List<Articles>
           
<div id="ArticlesList">
    @if (Model == null || Model.Count == 0)
    {
        <div>
            Статьи отсутствуют.
        </div>
    }
    else
    {
        <ul class="list">
        @foreach (var art in Model)
        {
            <li>
                @Ajax.ActionLink("Удалить", "DeleteArticle", new { articleId = art.ArticleId }, new AjaxOptions() { UpdateTargetId = "ArticlesList" })                        
                @art.Title
            </li>
        }
        </ul>
    } 
    <div id="AddArticle">
         @Ajax.ActionLink("Добавить статью", "AddArticle", new AjaxOptions() { UpdateTargetId = "AddArticle" })                        
    </div>           
</div>